function [ret] = get_adc_vec(s)

serial_pause = 0.005;
% Write to the serial port, only if it is open
done = 0;
while done == 0
    
%     try
        if strcmp(s.status, 'open')
            
            % Send the adc command            
            fprintf(s, 'adc\n');
            pause(serial_pause);
            
            while s.BytesAvailable < 11
                pause(serial_pause);
            end

            % While the number of bytes available is > 4, find the vector
            while s.BytesAvailable > 4                
                temp = fscanf(s);

                if ~isempty(regexp(temp, '<a>'))
                    ind1 = regexp(temp, '<a>');
                    ind2 = regexp(temp, '</a>');

                    ret = fliplr(str2num(temp((ind1 + 4) : (ind2 - 2))));
                    done = 1;
                end
                pause(serial_pause);
            end
        else
            disp('Serial port not open');
            ret = nan;
        end
%     catch ME
%         keyboard
%         ret = nan;
%         disp('Stupid serial port');
%         disp(ME)
%         disp(s)    
%     end
end

if s.BytesAvailable ~= 4
    disp('ADC Yikes!');
end